﻿using UnityEngine;
using System.Collections;

namespace UI
{
    public class UIUnionFightGatherPoint : MonoBehaviour
    {
        public UIToggle checkBox;
        public GameObject checkMark;
        public delegate void SetPoint();
        public SetPoint m_callback;
        public void OnCheckBox()
        {
            UIUnionFightMapPage.notShowAgain = checkBox.value;
            checkMark.SetActive(checkBox.value);
        }

        public void OnConfirm()
        {
            if(m_callback != null)
            {
                m_callback();
            }
            gameObject.SetActive(false);
        }

        public void Cancle()
        {
            UIUnionFightMapPage.notShowAgain = false;
            checkBox.Set(false);
            checkMark.SetActive(false);
            gameObject.SetActive(false);
        }

        public void Init(SetPoint func)
        {
            gameObject.SetActive(true);
            m_callback = func;
            GetComponent<PageTweener>().Play();
        }
    }
}

